/*
day376 
2020.9.7 
*/
#include<iostream>
#include<vector>
#include<map>
using namespace std;


class Solution {
public:
    vector<int> smallerNumbersThanCurrent(vector<int>& nums) {
        map<int,int> m;
        for(int i=0;i<nums.size();++i)
        {
        	m[nums[i]]++;
		}
		
		map<int,int> m1;
		int count=0;
		for(auto &i : m)
		{
			m1[i.first]=count;
			count+=i.second;
		}
		
		vector<int> res(nums.size());
		for(int i=0;i<nums.size();++i)
		{
			res[i]=m1[nums[i]];
		}
		
		return res;
    }
};

int main()
{
	return 0;
 } 
